package mvc.views.mediators
{
	import mvc.Notifications;
	import mvc.views.layers.BackgroundLayer;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	public class MediatorBackgroundLayer extends Mediator implements IMediator
	{
		public static const NAME:String = "MediatorBackgroundLayer";
		
		private var backGroundLayer:BackgroundLayer;
		public function MediatorBackgroundLayer(mediatorName:String=null, viewComponent:Object=null)
		{
			super(mediatorName, viewComponent);
			
			backGroundLayer = viewComponent as BackgroundLayer;
		}
		
		override public function listNotificationInterests():Array
		{
			// TODO Auto Generated method stub
			return [
				Notifications.MEDIATOR_TO_CHANGE_BACKGROUND
			
			];
		}
		
		override public function handleNotification(notification:INotification):void
		{
			// TODO Auto Generated method stub
			super.handleNotification(notification);
			
			switch(notification.getName())
			{
				case Notifications.MEDIATOR_TO_CHANGE_BACKGROUND:
					backGroundLayer.changeBackground(notification.getBody() as String);
					break;
			}
		}
		
		
	}
}